import 'package:base_flutter/base_flutter.dart';
import 'package:ls_work/net/net.dart';

import '../../a_yyt/models/address_book_entity.dart';
class AddressBookModel extends BaseMvvmModel{
  @override
  void onCleared() {
  }

  ///获取通讯录
  Future<List<AddressBookSection>> addressBookList() async {
    var map = {};
    var data = await HttpGo.instance.postData(HttpApi.findPhoeBookList,data: map,options: Options(contentType: Headers.jsonContentType));
    if("0"==data['code']){
      return ((data['data']['rows'] as List?)??[]).map((e) => AddressBookSection.fromJson(e)).toList();
    }else{
      throw data['msg'];
    }
  }
}